package methoddemo;

import java.util.Scanner;

public class methodTest1 {
    public static void main(String[] args) {
        /*
        需求：定义一个方法，求长方形的周长，将结果在方法中打印
         */

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入长方形的长和宽");
        getcircumference(sc.nextInt(), sc.nextInt());


    }


    public static void getcircumference(double lenth, double width) {
        double result = (lenth + width) * 2;
        System.out.println(result);
    }
}
